<%--
  Created by IntelliJ IDEA.
  User: danny
  Date: 2025/1/16
  Time: 14:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script src="${pageContext.request.contextPath}/js/echarts.min.js"></script>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>


<html>
<head>
    <title>Title</title>
</head>
<body>
   <div id="main" style="width: 100%;height: 400px">



   </div>
</body>
<script>
    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);
    var option;

    var ids=new Array();
    var index=0;

    <c:forEach items="${ids}" var="a">
      ids[index++]="${a}"
    </c:forEach>

    var totalAmounts=new Array();
    var index=0;

    <c:forEach items="${totalAmounts}" var="b">
    totalAmounts[index++]="${b}"
    </c:forEach>


    option = {
        xAxis: {
            type: 'category',
            data: ids
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                data: totalAmounts,
                type: 'line'
            }
        ]
    };
    myChart.setOption(option);

</script>
</html>
